﻿<!DOCTYPE html>
<html>
<head>
    <title>微信后台登录</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="__PUBLIC__/admin/css/login.css">
    <script type='text/javascript' src="__PUBLIC__/js/jquery.min.js"></script>
    <script type='text/javascript' src='__PUBLIC__/layer/layer.js'></script>
    <script type='text/javascript' src='__PUBLIC__/admin/js/common.js'></script>
</head>
<body>
   <div class="main">
        <img src="__PUBLIC__/admin/images/jin_bj.jpg" class="jin_bj" style="-moz-user-select:none;-webkit-user-select:none;" onselectstart="return false;"/>
        <div class="jin_content">
            <div class="jin_left">
                <img src="__PUBLIC__/admin/images/login_logo.png" />
                <h1>透析助手后台管理</h1>
            </div>
             <div class="jin_right">
                <h3>登录您的账号</h3>
                <div class="jin_name"><input type="text" name="name" placeholder="用户名"/></div>
                <div class="jin_pass"><input type="password" name="pass" placeholder="密码"/></div>
                <div class="load" id="queryButton" onclick="formSubmit(this)">登 录</div>
             </div>
        </div>
   </div>
<script>
function formSubmit(obj){
    $.post(
        "<{:U('Index/dologin')}>",
        {name:$("input[name='name']").val(),pass:$("input[name='pass']").val()},
        function(data){
            if(data.res=='suc'){
                note_info_login(data.msg,obj);
                setTimeout("location.href='"+data.url+"'",800);return;
            }else{
                note_info_login(data.msg,obj,'warn');
            }
        },'json');
}
function note_info_login(msg,obj,type){
    var sel = '#'+$(obj).attr('id');
    var color = type=='warn'?'#F58323':'#01348B';
    layer.tips(msg, sel, {
        tips: [1, color] //还可配置颜色
    })
    setTimeout("layer.closeAll()",1500);
}
$(function(){
    //背景图片高度
    var height=$(window).height();
    $(".main").height(height);
    //输入框的回车事件
    $("input[name=pass],input[name=name]").keypress(function(event){
        if(event.keyCode=='13'){
            $('#queryButton').click();
        }
    });
}); 
</script>	
</body>
</html>